{template 'common/header'}
<link rel="stylesheet" type="text/css" href="{MODULE_URL}template/style/main.css">
<script type="text/javascript" src="{MODULE_URL}template/style/main.js"></script>
<ul class="nav  mianbaoxue">
		<a  href="{php echo url('site/entry/Nav', array('m' => 'yts_qiye','setting_id' => $setting_id));}">返回导航列表页</a> >>
		{if $_GPC['id']}编辑内容{else}新增内容{/if}
   </ul>

   <form id="reply-form" action="" method="post" enctype="multipart/form-data" ng-controller="KeywordReply" class="ng-pristine ng-valid ng-scope">

	<input type="hidden" name="id" value="{$info[id]}">
	<div class="zeng_msgbox_layer_wrap" id="q_Msgbox" style="top:30%;display:block;display:none;">
		<span class="zeng_msgbox_layer" style="z-index:10000" id="mode_tips_v2">
			<span class="gtl_ico_hits"></span>
			<span class="tsmsg"></span>
			<span class="gtl_end"></span>
		</span>
	</div>


	<div class="panel panel-default module-1">
	
	    <div class="panel-body">

		    <div class="form-group">
			    <label for="firstname" class="col-sm-2 control-label">菜单名称</label>
			    <div class="col-sm-10">
			      <input type="text" name="name" class="form-control" id="title" placeholder="请输入名称" value="{$info[name]}">
			    </div>
			</div>
		    <div class="form-group">
					<label for="firstname" class="col-sm-2 control-label">排序</label>
					<div class="col-sm-10">
					  <input type="text" name="sort" class="form-control" id="sort" placeholder="请输入排序" value="{$info[sort]}">
					</div>
				</div>
			<div class="form-group">
					<label for="firstname" class="col-sm-2 control-label">类型</label>
					<div class="col-sm-3">
							<select id="type" name="type" class="form-control">
								<option value="1" {if ($info[type] == 1) OR ($info[type] == 0)} selected="selected" {/if}>小程序内</option>
								<option value="2" {if $info[type] == 2} selected="selected" {/if}>外部链接</option>
								<option value="3" {if $info[type] == 3} selected="selected" {/if}>电话</option>
							</select>

					  
					</div>

			</div>
			<div class="form-group {if $info[type] != 3}hidden{/if}" id="div_phone">
					<label for="lastname" class="col-sm-2 control-label">电话号码</label>
					<div class="col-sm-10">
							<input type="text" name="phone" class="form-control" id="phone" placeholder="请输入电话号码" value="{$info[phone]}">
							
					</div>
			</div>

			<div class="form-group {if $info[type] == 3}hidden{/if}" id="div_url">
					<label for="lastname" class="col-sm-2 control-label">跳转地址</label>
					<div class="col-sm-10">
							<input type="text" name="url" class="form-control" id="url" placeholder="请输入地址" value="{$info[url]}">
							<span class="help-block"><code>小程序内跳转路径 <a onclick="shuoming()" >请点击此处查看</a></code></span>
					</div>
			</div>
			
			<div class="form-group">
					<label for="lastname" class="col-sm-2 control-label">未选中ICON</label>
				
					<div class="col-sm-5">
						
						{php echo tpl_form_field_image('img',$info['img']);}
							
					
					</div>
						
			</div>
			<div class="form-group">
					<label for="lastname" class="col-sm-2 control-label">已选中ICON</label>
				
					<div class="col-sm-5">
						
							
						{php echo tpl_form_field_image('selimg',$info['selimg']);}
							
					</div>
						
			</div>






	    </div>
	</div>
		<div class="clearfix"></div>
		<div class="form-group reply-post-action we7-margin-top" style="text-align: center;">
			<div class="">
				{if $_GPC['id']}
				<input type="submit" class="btn btn-primary js-editor-submit multi-submit" style="width:200px" value="保存">
				{else}
				<input type="submit" class="btn btn-primary js-editor-submit multi-submit" style="width:200px" value="发布">
				{/if}
			</div>
		</div>


</form>




<script>
		$('#type').bind("change",function(){
			var index = this.selectedIndex;
			var val = this.options[index].value
		
			if(val == 3){
				if($('#div_phone').hasClass('hidden')){
					$('#div_phone').removeClass('hidden');
					$('#div_url').addClass('hidden');

				};
			}else{
				if(!$('#div_phone').hasClass('hidden')){
					
					$('#div_phone').addClass('hidden');
				};

				if($('#div_url').hasClass('hidden')){
					$('#div_url').removeClass('hidden');
				}
			}

		});


	

	</script>

{template 'common/footer'}